<template>
{{#if page.psSysPFPlugin}}
    {{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    <AppViewLayout :class="classNames">
        <template #viewHeaderLeft>
            <div v-if="model.showCaption && !noViewCaption" class="view-header__left__caption">
                {{> @macro/view/view-caption.hbs}}
            </div>
        {{#and page.enableQuickGroup page.quickGroupPSCodeList}}
            <div class="view-header__left__quickgroup">
                {{> @macro/common/quick-group.hbs}}
            </div>
        {{/and}}
        </template>
        <template #viewHeaderRight>
            {{#and page.enableQuickSearch (eq page.expandSearchForm false)}}
            <div class="view-header__right__quicksearch" v-show="!store.expandSearchForm">
                {{> @macro/common/quick-search.hbs}}
            </div>
            {{/and}}
            {{#each page.ctrls as | ctrl |}}
            {{#eq ctrl.controlType 'TOOLBAR'}}
            <div class="view-header__right__toolbar">
                {{> @macro/widgets/toolbar/toolbar.hbs page=page ctrl=ctrl}}
            </div>
            {{/eq}}
            {{/each}}
        </template>
        <template #viewContentTop>
            {{#each page.ctrls as | ctrl |}}
            {{#and (eq ctrl.controlType 'SEARCHFORM') (neq ctrl.formStyle 'SEARCHBAR')}}
            {{> @macro/widgets/form-detail/search-form.hbs ctrl=ctrl}}
            {{/and}}
            {{/each}}
        </template>
        <template #default>
            {{#each page.ctrls as | ctrl |}}
            {{#eq controlType 'CALENDAR'}}
            {{> @macro/widgets/calendar-detail/calendar.hbs ctrl=ctrl}}                
            {{/eq}}
            {{/each}}
        </template>        
        {{> @macro/view/view-msg.hbs}}      
    </AppViewLayout>
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div>
    {{/if}}
{{/if}}  
</template>
<script setup lang="ts">
// 基于template/src/views/\{{appModules}}/\{{pages@DECALENDARVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
{{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppViewLayout } from "@components/layout/view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { 
    useNavParamsBind,
    useEventBind,
{{#and page.enableQuickGroup page.quickGroupPSCodeList}}
    handleQuickGroupValueChange,
{{/and}}
{{#if page.enableQuickSearch}}
    handleQuickSearch,
{{/if}}
{{#page.ctrls}}
  {{#eq controlType 'TOOLBAR'}}
    handleToolbarItemClick,
  {{/eq}}
{{/page.ctrls}}
    handleCtrlAction, 
    handleCtrlInit, 
    handleCtrlDestroy, 
    getViewClassNames,
{{#unless page.psViewLayoutPanel.useDefaultLayout}}
    handleComponentAction,
{{/unless}}
} from "@/hooks/use-view";
import { IContext, IParam, ICalendarViewAbility, ILoadingHelper, CalendarViewController, ICalendarViewController, ICalendarViewControllerParams, CalendarViewActionType, ICalendarViewStore, IEvent } from "@/core";

{{> @macro/view/view-props.hbs}}

{{> @macro/common/emit.hbs name="view" actionType="CalendarViewActionType" ability="ICalendarViewAbility"}}    

//  样式名称
const classNames = computed(() => {
    return getViewClassNames(model, props);
});

const params: ICalendarViewControllerParams<CalendarViewActionType, ICalendarViewAbility> = { 
    name: props.name,
    model, 
    evt, 
    isLoadDefault: props.isLoadDefault,    
    openType:props.openType, 
    pLoadingHelper: props.pLoadingHelper, 
    handler: (data: ICalendarViewStore) => { return reactive(data); }
}

{{> @macro/common/controller.hbs name="view" IController="ICalendarViewController" store="ICalendarViewStore" ability="ICalendarViewAbility" controller="CalendarViewController"}}
</script>
